/*
 * @描述:
 * @作者: 约訂
 * @Date: 2024-07-15 10:49:39
 * @LastEditTime: 2024-09-04 10:05:02
 * @修改人员: 约訂
 */
import request from "@/utils/request";

// 获取产品分类
export function getClassify() {
  return request({
    url: "Category/CategoryTree",
    method: "get",
  });
}
/**新增分类 */
export function addClassify(data) {
  return request({
    url: "Category/Create",
    method: "post",
    data,
  });
}
/**修改分类 */
export function editClassify(data) {
  return request({
    url: "Category/Update",
    method: "post",
    data,
  });
}
/**删除分类 */
export function delClassify(id) {
  return request({
    url: "Category/Delete?id=" + id,
    method: "get",
  });
}
/**新增产品*/
export function addProductsOne(data) {
  return request({
    url: "Product/Create",
    method: "post",
    data,
  });
}
/**获取产品 */
export function getProductsOne(id) {
  return request({
    url: "Product/Get?id=" + id,
    method: "get",
  });
}
/**修改产品 */
export function editProductsOne(data) {
  return request({
    url: "Product/Update",
    method: "post",
    data,
  });
}
/**删除产品 */
export function delProductsOne(id) {
  return request({
    url: "Product/Delete?id=" + id,
    method: "get",
  });
}
/*新增类别 */
export function addCategoryOne(data) {
  return request({
    url: "ProductType/Create",
    method: "post",
    data,
  });
}
/**获取类别 */
export function getCategoryOne(id) {
  return request({
    url: "ProductType/Get?id=" + id,
    method: "get",
  });
}
/**修改类别 */
export function editCategoryOne(data) {
  return request({
    url: "ProductType/Update",
    method: "post",
    data,
  });
}
/**删除类别 */
export function delCategoryOne(id) {
  return request({
    url: "ProductType/Delete?id=" + id,
    method: "get",
  });
}
export default {
  getClassify,
  addClassify,
  editClassify,
  delClassify,
  addProductsOne,
  getProductsOne,
  editProductsOne,
  delProductsOne,
  addCategoryOne,
  getCategoryOne,
  editCategoryOne,
  delCategoryOne,
};
